package com.ricky.game;

import java.util.HashMap;
import java.util.Map;

import com.ricky.config.Unit.Unit;
import com.ricky.core.net.abs.Request;
import com.ricky.game.entity.Graphic;
import com.ricky.game.scene.SceneBase;

/**
 * 游戏中的逻辑对象
 * 玩家控制器
 * @author rik
 *
 */
public class Actor {

	//*************************** private ************************************
	/** 玩家显示信息 包括坐标资源等  */
	private Graphic graphic;
	/** 客户端信息 */
	private Map<String,Object>  attribute=new HashMap<String,Object>();
	/** 当前或者上次场景id */
	private int sceneID;
	private int id;
	private String name;
	
	private Unit unit;
	
	private Request request;

	private SceneBase scontroller;
	
	private SceneBase waiting;
	
	/**
	 * @return the unit
	 */
	public Unit getUnit() {
		return unit;
	}

	/**
	 * @param unit the unit to set
	 */
	public void setUnit(Unit unit) {
		this.unit = unit;
	}

	

	/**
	 * @return the id
	 */
	public int getId() {
		return id;
	}

	/**
	 * @param id the id to set
	 */
	public void setId(int id) {
		this.id = id;
	}

	/**
	 * @return the name
	 */
	public String getName() {
		return name;
	}

	/**
	 * @param name the name to set
	 */
	public void setName(String name) {
		this.name = name;
	}

	/**
	 * @return the request
	 */
	public Request getRequest() {
		return request;
	}

	/**
	 * @param request the request to set
	 */
	public void setRequest(Request request) {
		this.request = request;
	}
	
	
	public SceneBase getCurrentScene()
	{
		return scontroller;
	}
	
	public void setCurrentScene(SceneBase sceneController)
	{
		scontroller=sceneController;
	}

	/**
	 * @return the graphic
	 */
	public Graphic getGraphic() {
		return graphic;
	}

	/**
	 * @param graphic the graphic to set
	 */
	public void setGraphic(Graphic graphic) {
		this.graphic = graphic;
	}

	/**
	 * @return the sceneID
	 */
	public int getSceneID() {
		return sceneID;
	}

	/**
	 * @param sceneID the sceneID to set
	 */
	public void setSceneID(int sceneID) {
		this.sceneID = sceneID;
	}

	/**
	 * 设置坐标
	 * @param x
	 * @param y
	 * @param z
	 */
	public void setPostion(int x,int y,int z)
	{
		this.graphic.setX(x);
		graphic.setY(y);
		graphic.setZ(z);
	}

	/**
	 * @return the waiting
	 */
	public SceneBase getWaiting() {
		return waiting;
	}

	/**
	 * @param waiting the waiting to set
	 */
	public void setWaiting(SceneBase waiting) {
		this.waiting = waiting;
	}

	/**
	 * @return the data
	 */
	public Map<String,Object> getAttributeObject() {
		return attribute;
	}
	
	public void setAttribute(String key,Object value)
	{
		attribute.put(key, value);
	}
	
	public Object getAttribute(String key)
	{
		return attribute.get(key);
	}

}
